<template>
  <div id="app" ref="app">
    <router-view />
  </div>
</template>

<script>
  import _ from 'lodash'
  export default {
    name: 'App',
    created() {
      document.addEventListener('visibilitychange', () => {
        this.$store.commit('app/SET_DOCUMENT_VISIBILITY', document.hidden ? false : true);
      });
    },
    mounted() {
      // if (this._isMobile()) {
      //   if(window.location.hash.split('?')[0] != '#/examination/examinationpaper') {
      //     let url  = 'http://'+window.location.hostname
      //     let host = window.location.host
      //     if(host == '120.77.45.95:12311' || host == '39.108.61.54:12311'){
      //       url = url+':12590'
      //     }else{
      //       url = url+':12580'
      //     }
      //     // alert("手机端");
      //     window.location.href = url
      //   }
      // }
    },
    methods: {
      //App.vue，判断是否为移动端
      // _isMobile() {
      //   let flag = navigator.userAgent.match(
      //     /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
      //     )
      //   return flag;
      // }
    }
  }
</script>
